import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import { config } from './config'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login.vue'),
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes,
})

router.addRoute(routes, config[0])

// router.addRoutes([...config])
// config.forEach((item) => {
//   // console.log(item)

// })

console.log(router.addRoute, 'router')

export default router
